<?php
/**
 *       _____
 *      /  \  \      _       _    _____________   ___     ___ '  TM
 *     / /\ \  \    | |\    | |\ /_____   _____\ | - |   | - |
 *    / /  \ \  \   | | |   | | ||____/| |\____| | - |___| - |
 *   / /   /\ \  \  | | |   | | |    | | | |     | -  ___  - |
 *  / /   /  \ \  \ | |_|___| | |    | |_| |     | - |   | - |
 * / /___/    \ \__\|________ |/     |/___\|     |___|   |___|
 *________________________________________________________________________

 * Short description for file
 *
 * PHP version 5
 *
 * LICENSE: GNU General Public License v3
 *
 * @package    i18n
 * @author     Charly Poly <CharlyPoly@gmail.com>
 * @copyright  2009 Authentic Development Group
 * @license    GNU General Public License v3
 * @since      File available since Release 0.1.0
 */
class Translate {
    public function __construct($fichier, $lang) {
        if (!is_file($fichier.'cache.php')) {
            $content = file_get_contents($fichier);
            if (strpos($fichier, '.ini')) {
                return $this->TranslateIni($content);
            } else {
                return $this->TranslateXml($content);
            }
        } else {
            
        }
    }

    private function TranslateIni($content) {
        //parse
        //@return Object/array
    }

    private function TranslateXml($content) {
        //parse
        //@return Object/array
    }

    private function readCache() {
        
    }

    private function createCache() {
        
    }
}

class TranslateContent implements arrayaccess {
    private $container = array();
    
    public function __construct() {
        $this->container = array(
            "un"   => 1,
            "deux"   => 2,
            "trois" => 3,
        );
    }
    public function offsetSet($offset, $value) {
        $this->container[$offset] = $value;
    }
    public function offsetExists($offset) {
        return isset($this->container[$offset]);
    }
    public function offsetUnset($offset) {
        unset($this->container[$offset]);
    }
    public function offsetGet($offset) {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }
}
?>
